[LANG-1778] MethodUtils.getMatchingMethod() doesn't respect the hierarchy of methods#1414
[LANG-1778] MethodUtils.getMatchingMethod() doesn't respect the hierarchy of methods#1414garydgregory merged 3 commits intoapache:masterfrom
Conversation
|
Please fix build failures. You can run |
|
@garydgregory thanks, done! |
hierarchy of methods #1414 - Javadoc - Sort members - Simplify test
|
Hello @wuwu2000 YW 😄 Do you think the same type of issue applies to other callers of What about elsewhere in the class? |
|
So far only
are using this private method. getMethodsListWithAnnotation in my opinion is uncritical. You just get every method annotated and it works fine getAnnotation I just checked it has the same issue as getMatchingMethod had before this fix. To be honest, the thing that getAnnotation and getMatchingMethod find the method most "near" to the implementing class is more like a opinion. I guess the consumer may expect either
I think option 1 is the most intuitive (that's how spring mvc annotation system works, at least similar). Maybe MethodUtils.getAnnotation and MethodUtils.getMatchingMethod need additional parameters to be able to fulfil the expectations of the consumer? I think in nearer future the order of getAllSuperclassesAndInterfaces should be in the order concrete class => super => super.super etc.. => interfaces - sorry for my quite dirty fix only for getMatchingMethod, I wasn't sure how much I am allowed to change 🗡️ |
fix https://issues.apache.org/jira/browse/LANG-1778